package gwt.client;

import com.google.gwt.dom.client.Style;
import com.google.gwt.user.client.ui.*;

/**
 * Created by swootton on 20/03/14.
 *
 * TODO this extend FormPanel, then can update both if user
 * creates and then logs in to new repository? All needs same http settings
 * anyway.
 */
public class RepositoryPanel extends LayoutPanel {

    public RepositoryPanel() {

        Label mainTitle = new Label("RepositoryPanel");
        mainTitle.getElement().getStyle().setProperty("border","black solid 1px");

        //getElement().getStyle().setProperty("backgroundColor", "yellow");

        Widget login = new RepositoryLoginPanel();
        Widget create = new RepositoryCreatePanel();

        //login.getElement().getStyle().setProperty("border","black solid 1px");
        //create.getElement().getStyle().setProperty("border","black solid 1px");

        add(login);
        add(create);

        setWidgetLeftWidth(login, 0, Style.Unit.PC, 50, Style.Unit.PCT);
        setWidgetRightWidth(create, 0, Style.Unit.PC, 50, Style.Unit.PCT);

        // Because we're going to add a FileUpload widget, we'll need to set the
        // form to use the POST method, and multipart MIME encoding.
        //setAction("/myFormHandler");
        //setEncoding(FormPanel.ENCODING_MULTIPART);
        //setMethod(FormPanel.METHOD_POST);

    }
}
